use aarch64_define::Ptregs;

use crate::irq::handle_irqchip_irq;

#[doc(hidden)]
#[no_mangle]
pub unsafe extern "C" fn handle_arch_irq(_regs: &mut Ptregs) {
    handle_irqchip_irq();
    panic!("handle_arch_irq");
}

#[doc(hidden)]
#[no_mangle]
pub unsafe extern "C" fn bad_mode(_regs: &mut Ptregs, _reason: i32, _esr: u32) {
    panic!("bad_mode");
}

/// # Safety
/// 由启动代码调用
#[doc(hidden)]
#[no_mangle]
pub unsafe extern "C" fn do_mem_abort(_addr: usize, _esr: u32, _regs: &mut Ptregs) {
    panic!("do_mem_abort");
}

/// # Safety
/// 由启动代码调用
#[doc(hidden)]
#[no_mangle]
pub unsafe extern "C" fn do_sp_pc_abort(_addr: usize, _esr: u32, _regs: &mut Ptregs) {
    panic!("do_sp_pc_abort");
}

#[doc(hidden)]
#[no_mangle]
pub unsafe extern "C" fn do_undefinstr(_regs: &mut Ptregs) {
    panic!("do_undefinstr");
}

#[doc(hidden)]
#[no_mangle]
pub unsafe extern "C" fn do_debug_exception(_addr: usize, _esr: u32, _regs: &mut Ptregs) {
    panic!("do_debug_exception");
}

#[doc(hidden)]
#[no_mangle]
pub unsafe extern "C" fn preempt_schedule_irq() {
    panic!("preempt_schedule_irq");
}

#[doc(hidden)]
#[no_mangle]
pub unsafe extern "C" fn do_el0_ia_bp_hardening(_addr: usize, _esr: u32, _regs: &mut Ptregs) {
    panic!("do_el0_ia_bp_hardening");
}

#[doc(hidden)]
#[no_mangle]
pub unsafe extern "C" fn do_fpsimd_acc(_esr: u32, _regs: &mut Ptregs) {
    panic!("do_fpsimd_acc");
}

#[doc(hidden)]
#[no_mangle]
pub unsafe extern "C" fn do_sve_acc(_esr: u32, _regs: &mut Ptregs) {
    panic!("do_sve_acc");
}

#[doc(hidden)]
#[no_mangle]
pub unsafe extern "C" fn do_fpsimd_exc(_esr: u32, _regs: &mut Ptregs) {
    panic!("do_fpsimd_exc");
}

#[doc(hidden)]
#[no_mangle]
pub unsafe extern "C" fn do_sysinstr(_esr: u32, _regs: &mut Ptregs) {
    panic!("do_sysinstr");
}

#[doc(hidden)]
#[no_mangle]
pub unsafe extern "C" fn do_notify_resume(_regs: &mut Ptregs, _thread_flags: u32) {
    panic!("do_notify_resume");
}

#[doc(hidden)]
#[no_mangle]
pub unsafe extern "C" fn el0_svc_handler(_regs: &mut Ptregs) {
    panic!("el0_svc_handler");
}

#[doc(hidden)]
#[no_mangle]
pub unsafe extern "C" fn do_serror(_regs: &mut Ptregs, _esr: u32) {
    panic!("do_serror");
}

#[doc(hidden)]
#[no_mangle]
pub unsafe extern "C" fn bad_el0_sync(_regs: &mut Ptregs, _reason: i32, _esr: u32) {
    panic!("bad_el0_sync");
}
